package com.lh.mapper;

import com.lh.my.mapper.MyMapper;
import com.lh.pojo.Items;
import com.lh.pojo.vo.SearchItemsVO;
import com.lh.pojo.vo.ShopCartVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ItemsExtMapper extends MyMapper<Items> {

    /**
     * 根据关键字模糊查询商品
     * @param map
     * @return
     */
    List<SearchItemsVO> searchItemsByKeywords(@Param("map") Map<String, Object> map);

    /**
     * 根据商品分类Id搜索商品
     * @param map
     * @return
     */
    List<SearchItemsVO> searchItemsByCatId(@Param("map") Map<String, Object> map);

    /**
     * 刷新购物车商品规格
     * @param specIdList
     * @return
     */
    List<ShopCartVO> refreshShopCart(@Param("specIdList") List<String> specIdList);

    /**
     * 更改库存
     * @param specId
     * @param buyCounts
     * @return
     */
    Integer decreaseItemSpecStock(@Param("specId") String specId, @Param("buyCounts") Integer buyCounts);
}